<?php
	session_start();
	include("connect.php");
	$name = $_POST['Username'];
	$result = mysql_query("SELECT * FROM user WHERE Username='$name'");
	while ($row = mysql_fetch_array($result)) {
		if ($_POST['Password']==$row['Password']) {
			echo "<script>location.href='detail.php';</script>";
			$_SESSION['userinfo']=$name;  
		}
		else{
		   echo "<br><br><br><br>";
	       echo "<h1 align='center'>Something just wrong!</h1>";
	       echo "<br>";
	       echo "<div style='text-align:center;'>";
	       echo "<a href='../homebill/detail.php'>Get back</a>";
	       echo "</div>";
		   exit;
		}

	}	
?>